﻿using RSModels;
using System;
using System.Windows;

namespace RSDesktop.Views
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public Workspace CurrentWorkspace { get; set; } = new Workspace();

        public MainWindow()
        {
            InitializeComponent();
            Hide();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            new LoginWindow(CurrentWorkspace).ShowDialog();
            if (CurrentWorkspace.CurrentUser == null)
                Environment.Exit(0);
            else
                new WorkWindow(CurrentWorkspace).ShowDialog();

            Environment.Exit(0);
        }
    }
}
